<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <input type="text" id="i1">
    <input type="button" value="开始" id="i2">
    <input type="button" value="结束" id="i3">
<script>
    var i1 = document.getElementById("i1");
    var i2= document.getElementById('i2');
        i2.onclick = function () {
            var date1 = new Date()
            i1.value = date1.toLocaleString()
            var b = setInterval('var date1 = new Date()',1000);
            var c = setInterval('i1.value = date1.toLocaleString()',1000);
        }
    var i3= document.getElementById('i3');
        i3.onclick = function () {
            location.reload();
        }
</script>
</body>
</html>